{extend name='admin@main'}

{block name="button"}
{empty name='Think.get.back'}
{if auth("add")}
<button data-modal='{:url("add")}' data-title="添加计划" class='layui-btn layui-btn-sm layui-btn-primary'>添加计划</button>
{/if}

{if auth("remove")}
<button data-action='{:url("remove")}' data-rule="id#{key}" data-csrf="{:systoken('remove')}" data-confirm="确定要删除这些计划吗？" class='layui-btn layui-btn-sm layui-btn-primary'>删除计划</button>
{/if}
{/empty}
{/block}

{block name="content"}
<div class="think-box-shadow">
    {empty name='Think.get.back'}
    {include file='plan/index_search'}
    {/empty}
    <table class="layui-table" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='text-left nowrap'>仓库名称</th>
            <th class='text-left nowrap'>录入人员</th>
            <th class='text-left nowrap'>计划日期</th>
            <th class='text-left nowrap'>每日预估件数</th>
            <th class='text-left nowrap'>预估团点数</th>
            <th class='text-left nowrap'>计划分拣人数</th>
            <th class='text-left nowrap'>计划车辆</th>
            <!-- <th class='text-left nowrap'>分拣人员单价</th>
            <th class='text-left nowrap'>车辆单价</th> -->
            <th class='text-center nowrap'>使用状态</th>
            <th class='text-left nowrap'>添加时间</th>
            <th class='text-left nowrap'></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <td class='text-left nowrap'>{$vo.name|default=''}</td>
            <td class='text-left nowrap'>{$vo.username|default=''}</td>
            <td class='text-left nowrap'>{$vo.plan_date|default='-'}</td>
            <td class='text-left nowrap'>{$vo.quantity|default='-'}</td>
            <td class='text-left nowrap'>{$vo.tuan_point|default='-'}</td>
            <td class='text-left nowrap'>{$vo.man_number|default='-'}</td>
            <td class='text-left nowrap'>{$vo.car_number|default='-'}</td>
            <!-- <td class='text-left nowrap'>{$vo.man_price|default='-'}</td>
            <td class='text-left nowrap'>{$vo.car_price|default='-'}</td> -->
            <td class='text-center nowrap'>
                {eq name='vo.status' value='0'}
                <span class="color-red">审核中</span>
                {if auth("get_check")}
                <a data-dbclick class="color-blue" data-title="查看审批流" data-modal='{:url("get_check")}?id={$vo.id}'>(详情)</a>
                {/if}
                {/eq}
                {eq name='vo.status' value='1'}<span class="color-green">审核通过</span>{/eq}
            </td>
            <td class='text-left nowrap'>
                {$vo.create_at|format_datetime}
            </td>
            <td class='text-left nowrap'>

                {if auth("plan_detail_index") && !empty($vo.status)}
                <a data-dbclick class="layui-btn layui-btn-sm layui-btn-normal" data-open='{:url("plan_detail/index")}?plan_id={$vo.id}&back=1'>订单明细</a>
                {/if}
                <!-- {if empty($vo.status)} -->
                <!-- {empty name='Think.get.back'} -->
                {if $vo.is_check}
                <a class="layui-btn layui-btn-sm layui-btn-warm" data-confirm="确定要通过该审批吗？" data-action='{:url("check")}' data-value="id#{$vo.id}">审批通过</a>
                {/if}
                {if auth("edit")}
                <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑计划" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
                {/if}

                {if auth("remove")}
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该计划吗？" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删 除</a>
                {/if}
                <!-- {/empty} -->
                <!-- {/if} -->
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>

{/block}
